---
title: clsLegalPersonManager maintenance
summary: legal person / firm maintenance
status: draft
owner: SAIF Documentation Generator
last_reviewed: 2026-08-21
library: SAIF.Application.Claim.Legal
reference_type: embedded
operation_id: OP-006
trigger: legal person / firm maintenance
---

# clsLegalPersonManager maintenance

Legal person / firm maintenance.

| Field | Value |
| --- | --- |
| **Operation ID** | OP-006 |
| **Trigger** | legal person / firm maintenance |
| **Inputs** | Current manager state, current claim/case context, and any workflow-specific parameters or collections. |
| **Outputs** | Updated collections, messages, or side effects specific to the operation. |
| **Primary components** | `clsLegalPersonManager` |
| **Entry point** | `SAIF.Application.Claim.Legal\clsLegalPersonManager.vb` |

## Steps

1. Lazily load legal persons, legal person types, and other firms (inline SQL lookups for type/firm code lists).
2. `InsertNewPerson`, `InsertNewPersonType`, `InsertNewFirm` add rows to the respective collections.
3. `DeletePerson` is guarded by `CanDeleteLegalPerson`; `DeletePersonType` and `DeleteFirm` remove from their collections.
4. `OnWrite` saves the 3 collections, then nulls `m_LegalPersonCol` to force a reload on next access.

- Primary rules: [BR-040](../business-rules.md#br-040-a-legal-person), [BR-041](../business-rules.md#br-041-after-a-legal-person-save%2C-the-person-collection-is-discarded-to-force-a-fresh-reload)

## Failure and edge-case behavior

- Failures surface as manager messages or blocked workflow actions specific to the source operation.

## Process flow

The following diagram visualizes this operation's control flow.

```mermaid
flowchart TD
  Start([Trigger]) --> S1[Load current state]
  S1 --> S2[Apply operation rules]
  S2 --> D{"Validation or security<br>issue?"}
  D -->|Yes| EndErr(["Return message or block<br>action"])
  D -->|No| EndOk(["Return updated workflow<br>state"])
```

## Related documentation
- [Index](../index.md)
- [Operations and processes](../operations-processes.md)
- [Business rules](../business-rules.md)
- [Security and authorization](../security-authorization.md)
- [Database tables](../database-tables.md)
- [SQL catalog](../sql/index.md)
- [Procedures](../procedures/index.md)
- [API reference](../api/index.md)

## Sources
- SAIF.Application.Claim.Legal\clsLegalPersonManager.vb
